<?php


namespace App\Http\observer;


use App\Exceptions\ApiException;
use App\Models\Floor;
use App\Models\Property;

class FloorObserver
{
    public function saving(Floor $floor)
    {
        $pr=Property::where("id",$floor->pid)->first();
        if (!$pr){
            throw new ApiException("楼栋不存在");
        }
    }
}
